#include <stdio.h>
#include <string.h>

char s[100005] = {0};
char stack[100005] = {0};
int top=0;
int ans[100005];
int main()
{
    int len, i;
    gets(s);
    len = strlen(s);
    for (i = 0; i < len; ++i)
    {
        if (s[i] == '(' || s[i] == '{')
        {
            stack[top] = i;
            top++;
        }
        else if (s[i] == ')')
        {
            if (top == 0 || s[stack[top - 1]] != '(')
            {
                printf("NO");
                return 0;
            }
            else
            {
                ans[i] = stack[top - 1];
                ans[stack[top - 1]] = i;
                top--;
            }
        }
    }
    if(top!=0){
        printf("NO");
    }else{
            for(i=0;i<len;++i){
        printf("%d ",ans[i]+1);
    }
    }

}